#ifndef _DYNAMICARRAY_H_
#define _DYNAMICARRAY_H_
#include <stdbool.h>
#define ElementType void*
#define INITDARRY(a)    DArray a;InitDynamicArray(&a);

typedef struct DynamicArray DArray;
struct DynamicArray
{
    ElementType *dp;//动态数组指针
    int size;//容量
    int len;//长度

    bool (*InsertArrayTail)(DArray *a,ElementType element);
    bool (*RemoveByElement)(DArray *a, ElementType element, bool (*funcPtr)(ElementType, ElementType),void (*ClearPtr)(ElementType));
    DArray (*FindElement)(DArray *a, void *element,bool (*funcPtr)(ElementType,ElementType));
    void (*DisplayDynamicArray)(DArray * a,void (*funcPtr)(ElementType));

    void (*Sort)(DArray *a,bool (*funcPtr)(ElementType,ElementType));
    void (*ClearDArray)(DArray *a, void (*funcPtr)(ElementType));
};



void InitDynamicArray(DArray *a);
//尾部插入


#endif